﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;
using System.ServiceModel;

namespace EPS.UI
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            using (ServiceFactory<EPS.Contracts.IUserInfo> t = new ServiceFactory<Contracts.IUserInfo>())
            {
                t.GetProxy().CheckLogin("admin", "admin");
            }

        }

        private void ToggleButton_Click(object sender, RoutedEventArgs e)
        {
            ToggleButton button = (ToggleButton)sender;

            foreach (UIElement item in this.stackToolBar.Children)
            {
                if (item is ToggleButton)
                {
                    ((ToggleButton)item).IsChecked = item == sender;
                }
            }

            switch (button.Content.ToString())
            {
                case "现场数据":
                    break;
                case "数据报表":
                    break;
                case "模版管理":
                    break;
                case "区域划分":
                    this.mainFrame.Navigate(new Uri("/ZoneManage/ZonePage.xaml", UriKind.Relative));
                    break;
                case "用户管理":
                    this.mainFrame.Navigate(new Uri("/UserManage/UserListPage.xaml", UriKind.Relative));
                    break;
                default:
                    break;
            }
        }
    }
}
